
export class TopicView {

    commuUserId: string;
    topicType: string;
    commuUserHeadPath: string;
    commuUserName: string;
    latestUserId: string;
    content: string;
    updateTime: Date;
    isTop: number;
    noReadMsg: number;
    status: string = "";

    constructor(topicInfo: any) {
        this.commuUserId = topicInfo.COMMU_USER_ID;
        this.topicType = topicInfo.TYPE;
        this.content = topicInfo.CONTENT;
        this.updateTime = topicInfo.UPDATE_TIME;
        this.isTop = topicInfo.IS_TOP;
        this.noReadMsg = topicInfo.NO_READ_MSG;
    }

    updateUserInfo(userInforDict: any) {
        let userInfo = userInforDict[this.commuUserId];
        if(userInfo) {
            this.commuUserHeadPath = userInfo.HEAD_PATH;
            this.commuUserName = userInfo.USER_NAME;
        }
    }
}